<%@page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>
<%@taglib uri="/WEB-INF/FCKeditor.tld" prefix="FCK"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>票易信息管理系统</title>
<link rel="stylesheet" href="/css/admin.css" type="text/css"/>
<link rel="stylesheet" href="/css/redmond.datepick.css" type="text/css" />
<script type="text/javascript" src="/js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="/js/jquery.datepick.min.js"></script>
<script type="text/javascript" src="/js/jquery.datepick-zh-CN.js"></script>
<script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#startTime").datepick();
	$("#endTime").datepick();
});
</script>
</head>
<body leftmargin="2" topmargin="2">
<s:form id="create" action="admin_goods" onsubmit="VF_goodsflag();return false;">
<s:hidden name="action" />
<s:hidden name="id" />
 <fieldset><legend>
 <s:if test="%{action=='doadd'}">添加票务方式</s:if>
 <s:if test="%{action=='doupdate'}">修改票务方式</s:if>
 </legend>
 <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <COLGROUP>
  <COL width="100" />
  <COL width="*" />
  	<tr class="tdbg2"> 
      <td align="right" >类  别：</td>
      <td><s:select list="categoryList" name="categoryId" id="categoryId" listKey="key" listValue="value"></s:select></td>
    </tr>
    <tr class="tdbg2"> 
      <td align="right" >名  称：</td>
      <td><s:textfield id="name" name="name" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">大  图：</td>
      <td><s:textfield id="bigImg" name="bigImg" size="20"/>&nbsp;<input type="button" name="bigImgSubmit" value="上传图片" onclick="window.open('admin_upload_pic.action?editId=bigImg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')" /></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">小  图：</td>
      <td><s:textfield id="smallImg" name="smallImg" size="20"/>&nbsp;<input type="button" name="smallImgSubmit" value="上传图片" onclick="window.open('admin_upload_pic.action?editId=smallImg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')" /></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">座位图：</td>
      <td><s:textfield id="seatImg" name="seatImg" size="20"/>&nbsp;<input type="button" name="seatImgSubmit" value="上传图片" onclick="window.open('admin_upload_pic.action?editId=seatImg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')" /></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">开始时间：</td>
      <td><s:textfield id="startTime" name="startTime" size="20"><s:param name="value"><s:date name="startTime" format="yyyy-MM-dd" /></s:param></s:textfield></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">结束时间：</td>
      <td><s:textfield id="endTime" name="endTime" size="20"><s:param name="value"><s:date name="endTime" format="yyyy-MM-dd" /></s:param></s:textfield></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">是否显示：</td>
      <td><s:select list="isShowList" name="isShow" id="isShow" listKey="key" listValue="value"></s:select></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">状  态：</td>
      <td><s:select list="stateList" name="state" id="state" listKey="key" listValue="value"></s:select></td>
    </tr>
	<tr class="tdbg3"> 
      <td align="right">排  序：</td>
      <td><s:textfield id="orders" name="orders" size="20"/></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">城  市：</td>
      <td><s:select list="cityList" name="cityId" id="cityId" listKey="key" listValue="value"></s:select></td>
    </tr>
    <tr class="tdbg3"> 
      <td align="right">场  馆：</td>
      <td><s:textfield id="site" name="site" size="20"/></td>
    </tr>
    <tr class="tdbg2"> 
      <td align="right">详  情：</td>
      <td>
      <s:textarea id="details" rows="10" cols="100" name="details"></s:textarea>
      <script type="text/javascript">
	  var oFCKeditor = new FCKeditor('details') ;
	  oFCKeditor.BasePath = "/FCKeditor/" ;
	  oFCKeditor.Height = 400;
	  oFCKeditor.ToolbarSet = "Default" ; 
	  oFCKeditor.ReplaceTextarea();
	 </script>
      </td>
    </tr>
     <tr class="tdbg3">
      <td colspan="2" align="center"><s:submit value="提交"/></td>
    </tr>
</table></fieldset>
</s:form>
<script type="text/javascript">
function VF_goodsflag(){ 
    var errMsg = "";
	if ($('#details').val() == ""){
        errMsg = "请填写详情信息！";
    }
    if ($('#site').val() == ""){
        errMsg = "请填写场馆信息！";
    }
    if(isNaN($('#orders').val())){
		errMsg = "排序请添写数字！";
	}
    if ($('#state').val() == -1){
        errMsg = "请选择状态！";
    }
    if ($('#isShow').val() == -1){
        errMsg = "请选择显示信息！";
    }
    if ($('#endTime').val() == ""){
        errMsg = "请填写结束时间！";
    }
    if ($('#startTime').val() == ""){
        errMsg = "请填写开始时间！";
    }
    if ($('#smallImg').val() == ""){
        errMsg = "请选择小图！";
    }
    if ($('#bigImg').val() == ""){
        errMsg = "请选择大图！";
    }
    if ($('#name').val() == ""){
        errMsg = "请填写名称！";
    }
    if ($('#categoryId').val() == -1){
        errMsg = "请选择类别！";
    }
    if (errMsg != ""){
        alert(errMsg);
    }else{
		document.getElementById('create').submit();
	}
}
</script>
</body>
</html>
